import uuid as uuid

from django.contrib.auth.models import AbstractUser
from django.db import models


# Create your models here.
class Account(AbstractUser):
    id = models.CharField(primary_key=True, auto_created=True, default=uuid.uuid4, editable=False,max_length=255)
    nickname = models.CharField(max_length=20, verbose_name='昵称')
    sex_choice = ((1, '男'), (0, '女'))
    sex = models.SmallIntegerField(choices=sex_choice, verbose_name="性别", null=True, blank=True)
    email = models.EmailField(unique=True)
    phone = models.IntegerField(verbose_name='手机号', null=True, blank=True)
    birth = models.DateField(verbose_name='出生日期', null=True, blank=True)
    avatar = models.CharField(max_length=255,null=True, blank=True, verbose_name='头像')


#好友列表
class Friends(models.Model):
    id =  models.CharField(primary_key=True, auto_created=True, default=uuid.uuid4, editable=False,max_length=255)
    user_id = models.CharField(null=False,blank=False,max_length=255)
    friend_id = models.CharField(max_length=255,null=False,blank=False)

#文件管理
class Files(models.Model):
    id = models.CharField(primary_key=True, auto_created=True, default=uuid.uuid4, editable=False,max_length=255)
    type_choices = ((0, '文件'), (1, '视频'), (2, '图片'))
    type = models.SmallIntegerField(choices=type_choices, blank=True, verbose_name='存储类型')
    fileUrl = models.FileField(upload_to='Files/%Y%m%d', blank=True)